'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.mergeSetSafe = exports.mergeSetWithEnd = exports.mergeSet = undefined;

var _set = require('lodash/set');

var _set2 = _interopRequireDefault(_set);

var _flatObj = require('./flatObj');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var mergeSet = exports.mergeSet = function mergeSet(data, map) {
    var _map = (0, _flatObj.flatObj)(map);
    for (var k in _map) {
        (0, _set2.default)(data, k, _map[k]);
    }
    return data;
};
var mergeSetWithEnd = exports.mergeSetWithEnd = function mergeSetWithEnd(data, map) {
    var _map = (0, _flatObj.flatObjWithEnd)(map);
    for (var k in _map) {
        (0, _set2.default)(data, k, _map[k]);
    }
    return data;
};
var mergeSetSafe = exports.mergeSetSafe = function mergeSetSafe(data, map) {
    var _map = (0, _flatObj.flatObjSafe)(map);
    for (var k in _map) {
        (0, _set2.default)(data, k, _map[k]);
    }
    return data;
};

exports.default = mergeSet;